<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>编辑界面</title>
</head>
<body>
<form action="/update" method="post">
    <table>
        <input type="hidden" th:value="${emp.empno}" name="empno">
        <tr>
            <td>姓名：</td>
            <td>
                <input type="text" name="ename" th:value="${emp.ename}">
            </td>
        </tr>
        <tr>
            <td>工作：</td>
            <td><input type="text" name="job" th:value="${emp.job}"></td>
        </tr>
        <tr>
            <td>工资：</td>
            <td><input type="number" name="sal" th:value="${#numbers.formatDecimal(emp.sal,0,2)}">
            </td>
        </tr>
        <tr>
            <td>奖金</td>
            <td>
                <input type="text" name="comm" th:value="${#numbers.formatDecimal(emp.comm,1,2)}">
            </td>
        </tr>
        <tr>
            <td>入职日期：</td>
            <td>

                <input type="date" name="hiredate" th:value="${#dates.format(emp.hiredate,'yyyy-MM-dd')}">
            </td>
        </tr>
        <tr>
            <td>部门</td>
            <td><select name="dept.deptno">
                <option th:each="dept:${depts}" th:value="${dept.deptno}" th:text="${dept.dname}"
                        th:selected="${dept.deptno==emp.dept.deptno}"></option>
            </select>
            </td>
        </tr>
    </table>
    <input type="submit" value="修改">
</form>
</body>
</html>